package com.xgk.boot.module.core.controller.admin.channel.vo.spapi;

import com.mzt.logapi.starter.annotation.DiffLogField;
import com.xgk.boot.framework.common.enums.CommonStatusEnum;
import com.xgk.boot.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Schema(description = "管理后台 - API服务创建/更新 Request VO")
@Data
public class ApiSaveReqVO {

    @Schema(description = "API服务ID", example = "1")
    private Long asId;

    @Schema(description = "API服务代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "API服务代码不能为空")
    @DiffLogField(name = "API服务代码")
    private String asCode;

    @Schema(description = "API服务代码引用")
    @DiffLogField(name = "API服务代码引用")
    private String asCodeRef;

    @Schema(description = "API服务名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "API服务名称不能为空")
    @DiffLogField(name = "API服务名称")
    private String asName;
//
//    @Schema(description = "API服务类型", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotNull(message = "API服务类型不能为空")
//    @DiffLogField(name = "API服务类型")
//    private Integer asType;
    

    @Schema(description = "服务状态", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "服务状态不能为空")
    @InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
    @DiffLogField(name = "服务状态")
    private Integer asStatus;

//    @Schema(description = "是否试用", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
//    @NotNull(message = "是否试用不能为空")
//    @DiffLogField(name = "是否试用")
//    private Integer asTrial;

    @Schema(description = "API服务地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "API服务地址不能为空")
    @DiffLogField(name = "API服务地址")
    private String asAddress;

    @Schema(description = "API服务账号")
    @DiffLogField(name = "API服务账号")
    private String asUser;

    @Schema(description = "API服务密码")
    @DiffLogField(name = "API服务密码")
    private String asPwd;

    @Schema(description = "API服务Token")
    @DiffLogField(name = "API服务Token")
    private String asToken;

    @Schema(description = "API服务Key")
    @DiffLogField(name = "API服务Key")
    private String asKey;

    @Schema(description = "API服务产品代码")
    @DiffLogField(name = "API服务产品代码")
    private String asApplication;

    @Schema(description = "服务类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "服务类型不能为空")
    @DiffLogField(name = "服务类型")
    private Integer serviceType;

    @Schema(description = "标签预报", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "标签预报不能为空")
    @DiffLogField(name = "标签预报")
    private Integer labelPre;

    @Schema(description = "API服务等级")
    @DiffLogField(name = "API服务等级")
    private String serviceLevel;

    @Schema(description = "其他信息")
    @DiffLogField(name = "其他信息")
    private String other;

    @Schema(description = "备注")
    @Size(max = 500, message = "备注长度不能超过500个字符")
    @DiffLogField(name = "备注")
    private String remark;
}